/*
 * @Description: 我的道具
 * @Author: iamsmiling
 * @Date: 2021-05-30 21:07:35
 * @LastEditTime: 2021-06-13 11:24:42
 */

import 'package:credit_business_circle/R/R.dart';
import 'package:credit_business_circle/domain/local/prop/prop_kit_tab_entity.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'fragment/mine_prop_kit_body.dart.dart';
import 'fragment/prop_kit_mall_body.dart';
import 'fragment/prop_kit_record_body.dart';
import 'prop_kit_controller.dart';

class PropKitPage extends GetView<PropKitController> {
  const PropKitPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("我的道具"),
        elevation: 0,
      ),
      body: DefaultTabController(
          length: controller.tabs.length,
          child: Column(
            children: [
              Container(
                color: R.color.fffcfcfc,
                child: TabBar(tabs: [
                  for (PropKitTabEntity tab in controller.tabs)
                    Tab(
                      child: Text(tab.label),
                    )
                ]),
              ),
              Divider(
                height: 1,
              ),
              Expanded(
                  child: TabBarView(
                children: [
                  PropkitMallBody(cards: controller.cards),
                  MinePropKitBody(
                    props: controller.props,
                  ),
                  PropKitRecordBody(
                    records: controller.records,
                  )
                ],
              ))
            ],
          )),
    );
  }
}
